package com.train.mgr.modules.system.dto.request;

import com.train.mgr.modules.system.dto.request.groups.Insert;
import com.train.mgr.modules.system.dto.request.groups.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * MenuReqDTO
 *
 * @author cxg
 * @since 2023-03-25 19:55:38
 */
@Data
public class
MenuReqDTO {

    @ApiModelProperty(name = "id", value = "菜单id")
    @NotNull(message = "菜单id必填", groups = {Update.class})
    private Long id;

    private Long pid;

    @ApiModelProperty(name = "type", value = "菜单类型",required = true)
    @NotNull(message = "菜单类型必填", groups = {Insert.class, Update.class})
    @Range(max = 2, message = "菜单类型必须在{min}-{max}范围内", groups = {Insert.class, Update.class})
    private Integer type;

    @ApiModelProperty(name = "permission", value = "权限",required = true)
    @Length(max = 255, message = "权限长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String permission;

    @ApiModelProperty(name = "title", value = "菜单标题",required = true)
    @Length(max = 255, message = "菜单标题长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String title;

    @ApiModelProperty(name = "name", value = "组件名称",required = true)
    @Length(max = 255, message = "组件名称必须在{max}以内", groups = {Insert.class, Update.class})
    private String name;

    private Integer sort;

    @ApiModelProperty(name = "path", value = "链接地址",required = true)
    @Length(max = 255, message = "链接地址长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String path;

    @ApiModelProperty(name = "component", value = "组件长度",required = true)
    @Length(max = 255, message = "组件长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String component;

    @NotBlank(message = "菜单分类必填", groups = {Insert.class, Update.class})
    @ApiModelProperty(name = "menuCategory", value = "菜单分类（0-运营管理用户，1-企业管理用户，3-全部可见）",required = true)
    private String menuCategory;

    private Boolean iframe;

    private Boolean cache;

    private Boolean hidden;

    @ApiModelProperty(name = "icon", value = "图标",required = true)
    @Length(max = 255, message = "图标长度必须在{max}以内", groups = {Insert.class, Update.class})
    private String icon;

}
